Ubuntu 12.04 Compile link library order problem
1. Description of the phenomenon
In the process of compiling Ubuntu 12.04, it is often found that the ubuntu9.10 can compile the program in the 12.04 compiler does not pass, reported "undefined reference toxxxxx" error, as shown in the following figure:
2. Problem analysis
After a simple attempt, you can compile the past using the following methods:
Gcc-o XPointer xpointer.c-lx11
So: What's the difference between "Gcc-lx11-o xpointer xpointer
status Vmid??? — VM's process number, that is, the currently running Java process number interval– interval time, Units are seconds or milliseconds count?? — number of prints, and if you print countless times by default S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC 0.00 8.98 11.16 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 12.79 69.83
The link sequence of the gcc LibraryPreface recently, a program developed on MIPS needs to use floating point operations. Write the bootloader and main function, and call the log floating point operation in the main function, including the math library. Then write the makefile and ld scripts. The gcc parameters use: CFLAGS =-c-march = 3081-msoft-float-fno-inline $(ENDIAN)-G0 ld parameters: LDFLAGS =-march = 3081-msoft-float-nostartfiles-lgcc-lm-lc-Wl,
file is missing.[Solution]
1. Specify to connect to the GCC library during connection,-lgcc
-Lgcc indicates that the linker will connect to the GCC support library libgcc.. -LM indicates that the linker will connect to the standard library libm of GCC. a,-LC indicates that the linker will connect to the Standard C library libc of GCC. a. if all three of them are required, the connection order is-lm-LC-
What is the difference between GCC and G ++? I searched for it online and then again. There are a lot of strange ideas from around the world. Please read the document directly ..
Quote:" The use Gcc Does not add the C ++ library. G ++ Is a program that callgcc and treats' . C ',` . H And' . I 'Files as C ++ source files instead of C sourceFiles unless -X Is used, and automatically specifies linkingAgainst the C ++ Library "(BTW: C ++ header files under GCC generally use. HH)
Add t
ratioS1: Survival Zone 2 Current usage ratioE: Eden Area usage ratioO: Proportions used in the old ageM: Meta data Area usage scaleCCS: Compression usage ratioYGC: Number of young generations of garbage collectionFGC: Garbage collection times in the old ageFGCT: Time spent on garbage collection in the old ageGCT: Total GC consumption time -gccause garbage Collection Statistics Overview (same as-gcutil), additional reasons for the last two garbage collection events [root@izbp1bmo3l7m8z7ac5bi4wz
An error is reported when 32-bit Android 4.04 source code is compiled in ubuntu12.10 64-bit today:
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/x86_64-linux-gnu/4.5.4/libstdc ++. so when searching for-lstdc ++/usr/bin/ld: Skipping incompatible/usr/lib/GCC/x86_64-linux-gnu/4.5.4/libstdc ++. A when searching for-lstdc ++/usr/bin/ld: cannot find-lstdc ++/usr/bin/ld: skipping incompatible/usr/lib/GCC/x86_64-linux-gnu/4.5.4/libgcc_s.so when searching for-lgcc_s/usr/bin/ld: cannot find-lgcc_s/u
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.